package com.aizuda.boot.modules.business.employee.mapper;


import com.aizuda.boot.modules.business.department.domain.response.EmployeePermissionVO;
import com.aizuda.boot.modules.business.employee.domain.request.EmployeeQueryVO;
import com.aizuda.boot.modules.business.employee.domain.response.EmployeeQueryShowVO;
import com.aizuda.boot.modules.business.employee.domain.response.EmployeeSearchResultVO;
import com.aizuda.boot.modules.business.permission.domain.entity.EmployeeEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author duanyao
 * @date 2021/12/13 19:07
 * @description: 用户
 */
@Repository
public interface EmployeeMapper extends BaseMapper<EmployeeEntity> {


    /**
     * 查询当前登录员工权限
     * @param employeeId
     * @return
     */
    EmployeePermissionVO queryPermission(Long employeeId);


    /**
     * 查询员工列表
     * @param query
     * @return
     */
    List<EmployeeQueryShowVO> queryEmployee(@Param("query") EmployeeQueryVO query);

    /**
     * 根据姓名关键词模糊搜索员工
     * @param keyword 搜索关键词
     * @return 员工搜索结果列表
     */
    List<EmployeeSearchResultVO> searchEmployeesByName(@Param("keyword") String keyword);

    /**
     * 根据员工ID列表查询员工信息
     * @param employeeIds 员工ID列表
     * @return 员工信息列表
     */
    List<EmployeeQueryShowVO> queryEmployeeByIds(@Param("employeeIds") List<Long> employeeIds);

    /**
     * @param employeeId
     * @return
     */
    Integer getTenantId(Long employeeId);

    /**
     * 根据部门ID查询以该部门为主部门的员工ID列表
     * @param departmentId 部门ID
     * @return 员工ID列表
     */
    List<Long> getEmployeeIdsByMainDepartment(@Param("departmentId") Long departmentId);
}
